<?php

namespace app\Api\event;

use think\Controller;
use think\Loader;
use think\Db;

class Caravan extends Controller
{

    public function getInfo()
    {
    	//return Loader::model('Users')->getOrders();
    	//return $this->request->param();
    	return Loader::model('Caravans')->where('id',$this->request->param('id'))->find();
    }
    /**
     * [getCaravanAllTypes description]
     * @return [type] [description]
     */
    public function getCaravanAllTypes()
    {
        $caravanalltypes = [];
        $caravanalltypes['cates']       = Db::table('car_cates')->column('name', 'id');
        $caravanalltypes['brands']      = Db::table('car_brands')->column('name', 'id');
        $caravanalltypes['countries']   = Db::table('car_countries')->column('name', 'id');
        $caravanalltypes['drivers']     = Db::table('driver_types')->column('name', 'id');
        return $caravanalltypes;
    }
}
